<%-- 
  - Author: Raif Mahmoud
  - Date: 25-Mar-2011
  - Copyright Notice: TRAKHEES
  - Description: BreadCrumb.jsp
 --%>
<%@ include file="/WEB-INF/view/include.jsp"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

	
<sec:authorize access="isAuthenticated()">
<script type="text/javascript">
$.ajax({
	type : "GET",
	url : "user/general/home/breadcrumb",
	cache : false,
	contentType : "application/html",
	dataType : "html",
	success : function(result) {
		$("#breadcrumb").children().remove();
		$("#breadcrumb").append($(result));
	}
});
</script>
<sec:authorize access="hasAnyRole('ROLE_DEFAULT_USER','ROLE_COMPANY_EMPLOYEE','ROLE_INTERNAL_STAFF')"> 
		<script type="text/javascript">
			var i = 0;
			$().ready(function() {
				
				/*$.getJSON("user/general/home/userAnnouncement.json",
				    	 function(data) {
				   	$.each(data,function(key,announcement){ 		    		
				    		if(i == 3)
				    			return false;
				    		$("#announcement").append('<li><a>'+announcement.strAnnouncement+'</a></li>');
							
				    		++i;
				    	});
				  });*/

				 $.getJSON("user/general/home/userAnnouncement.json",
				    function(data) {
					if(data != null)
				    {
				    	$.each(data,function(key,request){
				    		if(i == 3)
				    			return false;
				    		<c:choose>
				    			<c:when
				    				test='${requestScope.requestContextAttribute.locale.language == "ar"}'>
				    					var requestDesc = request.strProcessCodeDescAr;
				    					
				    			</c:when>
				    			<c:otherwise>
				    					var requestDesc =  request.strProcessCodeDescEn;
				    			</c:otherwise>
			   				</c:choose>
			   				
			   				if(request.strWfStatus == "I")
			   				{
			   					status =  '<spring:message code="label.user.request.in.progress"/>';
			   					
				    		}else if(request.strWfStatus == "R")
				    						    		{
				    			status =  '<spring:message code="label.user.request.rejected"/>';
				    			
				    		}else{		
								
				    			status =  '<spring:message code="label.user.request.approved"/>';		
							}
			   				
				    		$("#announcement").append('<li><a class="t_fin-grey-txt"><spring:message code="msg.user.announcement"  arguments="'+requestDesc+', '+request.strClientRefNo+' , '+status+'" /></a></li>');
				    		++i;
						});
				    	
				    	if(data != null)
				    		$("#announcement").after('<hr>');
				    }
				 });
				
				
				 $.getJSON("user/general/home/userServiceList.json",
				    	 function(data) {
				    	
				    	$.each(data,function(key,service){ 		    		
				    		<c:choose>
				    			<c:when
				    				test='${requestScope.requestContextAttribute.locale.language == "ar"}'>
				    					var label = service.strServiceNameArb;
				    			</c:when>
				    			<c:otherwise>
				    					var label =  service.strServiceNameEng;
				    			</c:otherwise>
				   			</c:choose>
					    		
				   			$("#userServices").append('<li><a href='+service.strServiceURL+'>'+label+'</a></li>');
			
						});
			   			$("#userServices").append('<li><a href="/cedservices/home.htm">CED Customer Service</a></li>');
				    	
				    	
				    });
				
			  });
		</script>
 </sec:authorize>

<div class="t_left-menu-inner" dir='<spring:message code="page.dir"/>'
	align='<spring:message code="page.align"/>'>
	<div class="t_menu-heading"><spring:message code="label.welcome"/> : <sec:authentication property="principal.username" /></div>
	<ol id="announcement" class="topnav">
			
	</ol>	
	<ul class="topnav">
		<li>	
			<a href="<c:url value="/logout.htm"/>"><spring:message code="label.menu.logout"/></a>
		</li>
	</ul>
	
</div>

<div  class="t_left-menu-inner" dir='<spring:message code="page.dir"/>'
	align='<spring:message code="page.align"/>'>
	<div class="t_menu-heading"><spring:message code="label.menu.my.services"/></div>
	
	<ul class="topnav">
		<li><a href="user/general/home/show.htm"><spring:message code="label.menu.home"/></a></li>
		<sec:authorize access="hasRole('ROLE_INTERNAL_STAFF')">
			<li><a href="user/internal/workflow/inbox/list.htm"><spring:message code="label.inbox"/></a></li>
		</sec:authorize>
		<sec:authorize access="hasRole('ROLE_DEFAULT_USER')">
			<li><a href="user/profile/update/redirect/form.htm"><spring:message code="label.menu.update.user.profile"/></a></li>
			<li><a href="user/general/role/request/form.htm"><spring:message code="label.menu.update.role"/></a></li>
			<li><a href="user/general/service/show.htm"><spring:message code="label.menu.register.service"/></a></li>	
<%-- 			<li><a href="user/general/manage/list.htm"><spring:message code="label.menu.employees"/></a></li> --%>
<%-- 			<li><a href="user/general/manage/form.htm"><spring:message code="label.menu.create.employee"/></a></li>	 --%>
		</sec:authorize>
		<sec:authorize access="hasRole('ROLE_COMPANY_ADMIN')">
			<li><a href="user/general/manage/list.htm"><spring:message code="label.menu.employees"/></a></li>
			<li><a href="user/general/manage/form.htm"><spring:message code="label.menu.create.employee"/></a></li>	
		</sec:authorize>
		<sec:authorize access="hasRole('ROLE_COMPANY_EMPLOYEE')">
			<li><a href="user/general/employee/profile/form.htm"><spring:message code="label.menu.update.user.profile"/></a></li>
		</sec:authorize>	
		<!--<sec:authorize access="hasRole('ROLE_CLIENT')">
			<li><a href=""><spring:message code="label.menu.visa.renewal"/></a></li>
		</sec:authorize>
		<sec:authorize access="hasRole('ROLE_FREE_ZONE_LICENSE')">
			<li><a href=""><spring:message code="label.menu.freezone.license"/></a></li>
		</sec:authorize>
		--><sec:authorize access="hasRole('ROLE_ADMIN_IT')">
			<li><a href="admin/general/service/register/list.htm"><spring:message code="label.user.services"/></a></li>	
			<!--<li><a href="admin/general/service/register/form.htm">Define Service</a></li>	
			--><li><a href="admin/general/user/list.htm"><spring:message code="label.users"/></a></li>	
		</sec:authorize>
		
		
		<li>
			<a href="javascript:void(0)"><spring:message code="label.finance.online.services"/></a>
				<ul>	
					<li><a href="user/general/finance/prepaid/show.htm"><spring:message code="client.prepaid.account.report"/></a>						
				
					<!--<a href="user/general/finance/paymentadvice/show.htm"><spring:message code="client.payment.advice.report"/></a>
					--></li>					
				</ul>
		</li>
		
		
	</ul>
	<ul id="userServices" class="topnav">
	</ul>
</div>
</sec:authorize>
<sec:authorize access="isAnonymous()">

<div class="t_left-menu-inner" dir='<spring:message code="page.dir"/>'
	align='<spring:message code="page.align"/>'>
	<div class="t_menu-heading"><spring:message code="label.site.map"/></div>
	<ul class="topnav">
		<li><a href="user/general/home/show.htm"><spring:message code="label.menu.home"/></a></li>
		<li><a href="register/recallpin/form.htm"><spring:message code="label.site.map.recall.trakhees.pin"/></a></li>
		<li><a href="register/newclient/form.htm"><spring:message code="label.site.map.register.online.company"/></a></li>
		<li><a href="register/newclient/form.htm"><spring:message code="label.site.map.register.online.person"/></a></li>
		<li><a href="nonclient/company/register/form.htm"><spring:message code="label.site.map.register.company"/></a></li>
		<li><a href="nonclient/person/register/form.htm"><spring:message code="label.site.map.register.person"/></a></li>	
	</ul>
</div>
</sec:authorize>
<script language="javascript">
$(".topnav").accordion({
	accordion:false,
	speed: 500,
	closedSign: '<img src=\'resources/images/common/close.jpg\' />',
	openedSign: '<img src=\'resources/images/common/open.jpg\' />'
});
</script>
